package ruletaPage;

import giraronRuleta.GiraronLaRuletaPage;

import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.request.mapper.parameter.PageParameters;


import Ruleta.Mesa;
import Ruleta.Ruleta;
import applications.RuletaApplication;
import apuesta.TipoApuesta;

public class GirarRuletaPanel extends Panel{

	public GirarRuletaPanel(String id) {
		super(id);
		
		final Form<String> formulario = new Form<String>("formularioPanel"){
			
			public void onSubmit(){
				GiraronLaRuletaPage page = new GiraronLaRuletaPage();
				Mesa mesa = RuletaApplication.getInstance().getMesa();
				if(!(mesa.getYaGiro())){
					mesa.girar();
					setResponsePage(page);	
				}
				else
				{setResponsePage(page);}
				
			};
			
		};
		add(formulario);
	}

}
